#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

#define TRACE(x...) 
#define PRINT(x...) TRACE(printf(x))
#define WATCH(x) TRACE(cout << #x << " = " << x << endl)

#define rep(i,n) for (int i=0; i<n; i++)

#define f first
#define s second
#define mp make_pair

#define ll long long
#define INF 0x3f3f3f3f
#define NINF 0xc0c0c0c0

#define sqr(x) ((x)*(x))
int n;
int x;
int c[110];
int an;
int pd[110][10010];
int nj;

int main() {
	freopen("input.txt", "r", stdin);	
	freopen("output.txt", "w", stdout);

	scanf("%d %d", &n, &x);
	rep(i,n) scanf("%d", &c[i+1]);
	
	an=0;
	rep(i,n) rep(j,x) pd[i][j]=0;	
	rep(i,n) pd[0][i]=0;

	for (int i=1; i<=n; i++) {
		for (int j=0; j<=x; j++) {
			nj=j-(n-i+1)*c[i];
			if (nj>=0) pd[i][j]=max(pd[i-1][nj]+1,pd[i-1][j]);
			else pd[i][j]=pd[i-1][j];
		}
	}

	TRACE(
		rep(i,n+1) {
			rep(j,x+1) printf("%d ", pd[i][j]);
			printf("\n");
		}
	)

	an=-1;

	rep(i,n+1) rep(j,x+1) if (an<pd[i][j]) an=pd[i][j];
	printf("%d\n", an);

	return 0;
}
